<?php

include_once($_SERVER["DOCUMENT_ROOT"]."/home/header.php");

$id=$_GET['id'];
$_SESSION['id']=$id;
//var_dump($_SESSION['id']);
$_POST['ctime']=time();
$arr = selec($config,'zuopin',"where id={$id}")[0];

$pinn = sele($config,'pinlun',"where wid={$id}");

//var_dump($arr['dianji']);

$dianji = $arr['dianji'];
$dianji++;

$_SESSION['dianji']=$dianji;

$shuz = array('dianji'=>$_SESSION['dianji']);
//var_dump($shuz);
$oll = update($config,'zuopin',"where id={$id}",$shuz);
//var_dump($oll);
?>
<form action="" method="get" accept-charset="utf-8">
    <input type='hidden' name='dianji' value="<?php echo $_SESSION['dianji']?>">
</form>

<div id="templatemo_right_column">
        
        <div id="templatemo_main">
        
            <div class="post_section">
            
                <span class="comment">
                    <a href="blog_post.php">
                    <?php  echo $arr['dianji']?>
                    </a></span>
            
                <h2 name="title"><?php  echo $arr['title']?></h2>
    
                <strong name="ctime"><?php  echo date('Y-m-d H:i:s',$arr['ctime'])?>
                </strong>  | 
                <strong name="author">作者:<?php  echo $arr['author']?>
                </strong>  | <strong>类型:</strong> <a href="#">免费赠品</a>
                
                <a href="#" name="pic"><img src="<?php  echo $arr['pic']?>" alt="image" style='width:420px; height:150px;'/></a>
                <p name="content"><?php  echo $arr['content']?></p>
                
          </div>
            
            <div class="comment_tab">
                评论           
            </div>
            
      <div id="comment_section">
                <ol class="comments first_level">
                       

                        <?php
                            foreach ($pinn as $k => $v) {
                                echo"<li>
                            <div class='comment_box commentbox1'>
                                    
                                <div class='gravatar'>
                                    <img src='images/avator.png' alt='author' />
                                </div>
                                
                                <div class='comment_text'>
                                    <div class='comment_author'>".$v['name']."
                                    <span class='date'>
                                        ".date('Y-m-d H:i:s',$v['ctime'])."</span></div>
                                    <p>".$v['editorValue']."</p>
                                  <div class='reply'></div>
                                </div>
                                <div class='cleaner'></div>
                            </div> 
                        </li>";
                            }

                        ?>
                        <center>
        <a href="yuedu.php?p=1&id=<?php echo $arr['id']; ?>">首页</a>
        <a href="yuedu.php?p=<?php echo $_SESSION['shang'] ?>&id=<?php echo $arr['id']; ?>">上一页</a>
        <a href="yuedu.php?p=<?php echo $_SESSION['xia'] ?>&id=<?php echo $arr['id']; ?>">下一页</a>
        <a href="yuedu.php?p=<?php echo $_SESSION['fen'] ?>&id=<?php echo $arr['id']; ?>">尾页</a>
        总共<?php echo $_SESSION['fen']; ?>页  &nbsp;&nbsp;当前第<?php echo $_SESSION['p'];?>页</center>
                </ol>
                    
                </div>

                
                <!--隐藏评论<div id="comment_form">
                    <h3>留下你的评论</h3>
                    
                    <form action="#" method="post">
                        <div class="form_row">
                            <label><strong>姓名</strong> (必修的)</label>
                            <br />
                            <input type="text" name="name" />
                        </div>
                        <div class="form_row">
                            <label><strong>电子邮箱地址</strong>  (要求，不会公布)</label>
                            <br />
                            <input type="text" name="name" />
                        </div>
                        <div class="form_row">
                            <label><strong>评论</strong></label>
                            <br />
                            <textarea  name="comment" rows="" cols=""></textarea>
                        </div>
                        <input type="submit" name="Submit" value="Submit" class="submit_btn" />
                    </form>
                </div>-->
<script type="text/javascript" charset="utf-8" src="bianjiqi/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="bianjiqi/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="bianjiqi/lang/zh-cn/zh-cn.js"></script>

    <form action="doyuedu.php" method="post">   
    
    <script id="editor" type="text/plain" style="width:490px;height:150px;"></script>
    <input type="hidden" name="wid" value="<?php echo $_SESSION['id']?>"/>
    <input type="hidden" name="ctime"/>
    <input type="hidden" name="name"  value="<?php echo $_SESSION['name']?>"/>
    <input type="submit" value="提交留言" class="submit_btn" style="margin-left:423px" />

</form>
    <script type="text/javascript">

    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    var ue = UE.getEditor('editor',{toolbars: [
    ['emotion']
]});


</script>









            
        </div> <!-- end of main -->
    
  <div class="cleaner"></div>
  </div> 
    <!-- end of templatemo_main -->


<?php
include_once($_SERVER["DOCUMENT_ROOT"]."/home/footer.php");
 
?>